home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
edit
/
sted102a.zip
/
SUPERTED.DOC
< prev
next >
Wrap
Text File
|
1994-06-08
|
14KB
|
339 lines
S U P E R T E D v1.02a
=====================
This is version 1.02a of Superted, and contains the following bug
fixes/enhancements:
BUG FIXES
1. In word wrap mode, deleting an end of line which is followed by another end
of line now works properly.
2. In word wrap mode, word wrap on insertion/deletion no longer causes the
occasional shift of the text down by one line.
3. In word wrap mode, the bug which stopped the last line of a paragraph from
being wrapped when the paragraph is reformated, has been removed.
ENHANCEMENTS
1. It is now possible to configure the word wrap column (see configuration
section below)
Note: SEVERAL CONFIGURATION ADDRESSES HAVE BEEN CHANGED FROM VERSION 1.01.
---------------------------------------------------------------------------
Changes from version 1.00 to version 1.01
BUG FIXES
1. Correctly deletes end of line in non-word wrap mode.
2. Unpredictable crash on word wrap no longer occurs
3. Handling of marked text on word wrap/line join corected.
ENHANCEMENTS
1. Search and replace added (ALT-l)
2. Save without exit (Shift F7)
BACKGROUND
Programs like VIEW, SNEWS, PCelm, etc. all do a useful job. However, each
comes with the throwaway line "use your favourite text editor"", or something
similar. This is fine if you have a text editor that meets all your
requirements. However, what if you don't?
Text editors for use with mailers need to process text. They don't have to be
as sophisticated as a fully featured word processor, but ideally, they should
perform word wrap, enable the import of already written text, and support
common conventions, such as readily enabling other articles, or EMail to be
quoted - and not just the one that you are responding to.
Demon supply copies of PC Magazine's Tiny Editor (TED) to help get new users
going. This is a nice fast editor, but it is really a programmer's editor, and
built to handle ".BAT" files, and the like. Other readily available editors
like MSDOS Edit are very similar in what they can achieve.
At the other extreme, a true word processor, like MS Word, is just too
heavyweight for the job - and what you see is not always what you get, when
saving to a straight text format.
I spent much time looking around the Internet for a suitable editor for use
with the DIS suplied software. In the end, I didn't find what I wanted.
However, I did find something interesting. On SIMTEL20 is a modified version of
TED, called TEDPLUS. This is a hack of the TED code to add a search facility,
and such interesting features as single keystroke abort (hands up all those how
have never hit F1 by mistake) and an odd choice of colours. However, it also
comes with the source code.
The code with TEDPLUS was the original TED code plus modifications. The
temptation was there to use it as the basis for developing the editor that I
wanted, and that is what I have done. The result is SuperTED, which I have
made available to other users of DIS, as my way of saying thank you for all the
work put into the DIS software by other DIS members. I hope that you'll find it
useful.
SuperTED is the original TED plus the following features:
* Word Wrap on text entry
* Import of text from a file
* Import and Paste with quote character at start of line
* Configurable Colours and quote character
* Search for specified Text
* Reformat of text (word wrap existing text)
* Print of whole file when no text selected
* Help Screen
* Improved Error Messages.
In the process, much of TEDplus has gone - I even rewrote the search algorithm
- so SuperTED is very much enhanced TED 1.0, and not enhanced TEDplus. No
unecessary control-Z, and I even fixed the original TED bug that displayed the
diamond a column too early.
You don't get something for nothing, and SuperTED is now over 6KB,
compared with the original TED's 2.9KB. However, it seems to be just as fast as
before, even on my almost pensioned off 1640 PC-MD.
SuperTED is supplied in two versions. "ted.com" is the standard version, and
looks just like the old TED, except that F1 is now a help function. The escape
key is now the abort key. This version does not perform word wrap on start
up. This has to be explicitly toggled on and off using ALT-W.
The other version is "ted4mail.com" which is a conditional compilation that
has word wrap on by default, and does not prompt to confirm the filename on
exit. This version is the one expected to be used with mailers, when word wrap
is almost always required (ALT-W still works, if you want to turn it off) and
confirming the file name just gets in the way.
DISCLAIMER
SUPERTED IS NOT WARRANTEED AS FIT FOR ANY PURPOSE WHATSOEVER. IT IS USED AT THE
SOLE RISK OF THE USER, WHO IS CAUTIONED THAT THIS PROGRAM HAS NOT BEEN TESTED
TO A DEGREE SUFFICIENT FOR IT TO BE USED TO MAINTAIN, MODIFY OR BE IN CONTACT
WITH CRITICAL DATA. USERS THAT WISH TO USE IT IN SUCH SITUATIONS MUST CARRY OUT
THEIR OWN TESTING PROCEDURES IN ORDER TO DETERMINE THE SOFTWARE'S FITNESS FOR
PURPOSE.
That said, I have conducted limited testing on a 486 colour machine and 8086
B&W, and the basic functionality appears to work. I am actively using it for
my own purposes (like writing this document). I shall treat any reports of bugs
with sympathy and might even fix them.
WORD WRAP
=========
The word wrap algorithm is simple enough. Whenever a new character is entered,
the length of the displayable line (including TABS) is checked. If it is longer
than the screen width (determined at start up), then the start of the last word
on the screen is found, and a CR/LF inserted before it. If the line is indented
then the indent is copied and inserted after the new CR/LF thus preserving the
current indent. The join algorithm is then called to join the wrapped around
text to the next line.
JOIN
====
The join algorithm is called either explicitly (by ALT-J) or implicitly at the
end of the word wrap algorithm. JOIN finds the end of the current line and
deletes the CR/LF at the end of the line unless an End of File or End of
paragraph (a line of white space) is found. Any white space (TABS and spaces)
around the end of line marker is also deleted. A single space is then inserted
at the point of deletion. If word wrap is enabled, then the word wrap algorithm
is invoked if the newly joined line is wider than the screen width. Word wrap
will flow round until the current paragraph is correctly formatted.
Note that DEL with the cursor at end of line is equivalent to ALT-J.
REFORMAT
========
There are situations where the above will not format a paragraph correctly -
typically when the next line is a short line followed by a line wider than the
screen width. Also character insertion is the only way to force word wrap. In
such situations, REFORMAT is useful as a means of forcing proper format on text
without having to enter text or individually join lines.
Reformat (ALT-R) is simply a repetitive call to JOIN from the current cursor
position through to the end of the current paragraph (or end of file). This
forces reformatting of the remainder of the current paragraph.
If text is currently selected then Reformat applies to the whole of the current
selection.
IMPORT
======
F12 (or ALT-I) calls file import. The user is prompted for a filename, and the
file's contents is read into the paste buffer and then automatically pasted
into the current cursor location. The same text may be repasted using F6.
Note that all prompts for text entry have the same conventions now. Escape
aborts entry, DEL erases the currently displayed text, and ENTER completes text
entry. The previously entered text for the same prompt is always redisplayed at
the next call.
Import with quote character ('>') at the start of each line is identical to the
above, except that it is invoked by Shift F12 (or ALT-SHIFT-I).
The current contents of the paste buffer may also be pasted with the quote
character by Shift F6.
SEARCH
======
Search is invoked by F11 (or ALT-F). The user is prompted for a character
string and the file is searched for a (case blind) match until end of file is
reached. The found text, if any, is highlighted and the cursor positioned at
the start of the text. Note that the end of line marker is ignored by the
search algorithm, and hence searched for text may straddle a line boundary
(e.g. a hyphenated word broken at the hyphen by the word wrap algorithm).
A search may be repeated by Shift F11 (or ALT-SHIFT-F).
REPLACE
=======
Replace is invoked by ALT-L. The user is prompted for a character
string and the file is searched for a (case blind) match until end of file is
reached. The found text, if any, is highlighted and the cursor positioned at
the start of the text. The user is then prompted for replacement text.
Repeat search and replace is invoked bu Shift ALT-L.
PRINT
=====
Print (F3) with no text selected causes the whole file to be printed with a
Form Feed at End of File. As hitting F3 by mistake can be expensive, the user
is invited to confirm this operation.
CONFIGURATION
=============
Permanent reconfiguration of SuperTED is performed using the built-in DOS
configuration utility, invoked by typing:
DEBUG ted.com
or
DEBUG ted4mail.com
at the command line prompt. The first variation is used to configure the
standard version of superTED, while the second is used to configure the mail
version. The Superted program files must be in the current directory.
Each configurable parameter is modified by entering the command:
E <location> <hex value>
where <location> identifies the parameter, and <hex value> is the replacement
value. Terminate the command with the Enter key. Once all changes have been
made save the new configuration with the command:
W
again terminated with the Enter key, and type Q <enter> to terminate.
QUOTE CHARACTER
===============
The <location> of the quote character is 0106. To change the quote character,
use this <location> and, as the <hex value>, give the replacement character
enclosed in single quotes. e.g.
E0106 ':'
changes the quote character to a colon. Note that leading zeroes may be
omitted, and there is no need for a space after the initial E.
COLOURS
=======
There are three attribute bytes that may be configured by the user at locations
0103, 0104 and 0105, which respectively provide the colours for normal text,
inverse and text found by the Search function. In the supplied software, these
attribute bytes are set to the monochrome values. They are tested at start up
and if a colour monitor is available, the monochrome values are changed to the
current screen attribute byte, its inverse, and flashing inverse respectively.
If they are not the assumed monchrome values, then the values found in these
fields are used as the screen attribute bytes. The Hex values for each
attribute byte are calculated as follows:
0 0 0 1 | 1 1 1 1 e.g. 0x1f ---> Bright white on blue
---------------------------------
B R G B | I R G B
L E R L | N E R L
I D E U | T D E U
N E E | E E E
K N | N N
S
I
T
Y
For example, the commands:
E103 1F
E104 71
E105 F1
gives normal text - bright white on blue
Inverse text - blue on grey
Search text - flashing blue on grey.
WORD WRAP
=========
The word wrap flag is at location 0107. An hex value of 00 is off and FF is on.
WORD WRAP COLUMN
================
By default, word wrap occurs when the cursor moves out of the rightmost column
of the screen. This can be set to any column. Both absolute and relative
positioning of the word wrap column are possible.
The absolute word wrap column is set using location 010A. When this byte is
zero then the rightmost column of the screen is the word wrap column. If this
byte is non-zero then its value (unsigned integer) determines word wrap column.
For example, to set word wrap to column 75 (4BH) using DEBUG, enter:
E010A 4B
The relative word wrap column is set using location 0108. When location 010A is
zero, the value of this byte (signed integer) is subtracted from the screen
width to determine the word wrap column.
For example, to set word wrap to column 75 using DEBUG, enter:
E0108 05
PROGRAM INFORMATION
===================
SuperTED is written entirely in 8086 assembler and uses no protected mode
instructions. It is capable of detecting monochrome and colour displays, screen
width, and a BIOS that supports an extended keyboard. It should also handle
these different types of devices appropriately. This version of SuperTED was
compiled using Arrowsmith's public domain assembler (available on SIMTEL20 and
all good mirror sites), and linked using the MSDOS linker.
I have provided a copy of the source code for those who want more
configurability than offered.